package cz.muni.fi.pa165.dundd.dao;

import cz.muni.fi.pa165.dundd.entity.Administrator;
import java.util.List;

/** 
 * This class implements the data access object pattern for Administrator entity 
 * which is persisted in the database.
 * 
 * @author xdemocko
 */
public interface AdministratorDAO {
    
    /**
     * Method persists the administrator passed as parameter to the data source.
     * @param admin
     */
    public void createAdministrator(Administrator admin);
    
    /**
     * Method updates the administrator passed as parameter in the data source. 
     * 
     * @param admin
     */
    public void updateAdministrator(Administrator admin);
    
    /**
     * Deletes the administrator passed as parameter from the data source. 
     * @param admin
     */
    public void deleteAdministrator(Administrator admin);
    
    /**
     * Retrieves all administrators persisted in the data source.
     * @return list of administrators available in the database.
     */
    public List<Administrator> retrieveAllAdministrators();
    
    /**
     *  Retrieves administrator with given id (as parameter) from the data source.
     * 
     * @param id of the administrator being retrieved from the data source.
     * @return the administrator with the given id from the database.
     */
    public Administrator retrieveAdministratorById(Long id);

    public Administrator retrieveAdministrator(String username);
    
}
